#!/bin/bash 
i=1
tmpfile=$(mktemp)
while (( $i <= 30 )) ;
do
    (echo "$(date +%s.%N) $i"; echo $i >> $tmpfile ) &
    i=$(( $i +1 ))
done
wait

sort -n "$tmpfile" | cut -d' ' -f2-
rm "$tmpfile"


